<?php
    
    require_once( MODEL_DIR . "Model.class.php");
    
    class CadastroModel extends Model{
        
        protected $query;
        
        public function __construct()
        {
            parent::__construct();
        }
       
        # checa se o e-mail já existe 
        public function cad_check_email($email){
            
            $set_where = "login = '$email'";     
            return parent::read("usuario",$set_where,0,0,0);
        }
        
        # checa para ver se há um e-mail e uma senha para autenticar o usuário
        public function cad_check_login($email,$pass){
            $set_where = "login = '$email' AND password = '$pass'";
            return parent::read("usuario",$set_where,0,0,0);
                 
                        
        }
        
        public function cad_get_info($email,$pass){
            $set_where = "login = ".mysql_real_escape_string($email). " AND password = ".mysql_real_escape_string($pass);
            return parent::read("usuario",$set_where,0,1,0);
                 
                        
        }        
        
        
                
        
        
        
    }        
?>